from selenium import webdriver
import time
# 创建爱你一个浏览器对象
driver = webdriver.Chrome()

# 访问百度
url = 'http://www.baidu.com'
driver.get(url)
time.sleep(3)

# 定位到搜索框元素
el = driver.find_element_by_id('kw')
# 向输入框中输入数据
el.send_keys('传智教育')

# 定位搜索按钮
el_click = driver.find_element_by_id('su')
el_click.click()


time.sleep(5)
driver.close()